package models;

import java.util.Date;

import static javax.persistence.EnumType.STRING;
import static javax.persistence.TemporalType.DATE;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Inheritance;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import play.db.jpa.Model;

@Entity
@Inheritance
public abstract class BookRequest extends Model{

	@ManyToOne
	public Book book;
	
	@ManyToOne
	public User requester;
	
	/** hold details about the flow status*/
	@Enumerated(STRING)
	public BookRequestStatus status;
	
	/** if request is closed.*/
	public boolean closed;
	
	public String requestReason; 
	
	@Temporal(DATE)
	public Date createdDate;
}
